﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Drawing;   
using System.Windows.Forms;

namespace WindowsFormsApplication8
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form f = new Form();
            f.Paint += new PaintEventHandler(Paint);
            f.Click += new EventHandler(Click);
            Application.Run(f);
        }
        static void Click(object send,EventArgs e)
        {
            Form f = (Form)send;
            f.Text = Cursor.Position.X .ToString() + ":" + Cursor.Position.Y.ToString();
        }
        static void Paint(object send,PaintEventArgs e)
        {
            Form f = (Form)send;
            Graphics g = e.Graphics;
            g.Clear(Color.White);
            g.DrawString("hello world", f.Font, Brushes.Black, new Point(30, 30));
        }
    }
}
